﻿using Microsoft.Extensions.Configuration;
using System.Data;

namespace Student.Common
{
    public class ConnectionFactory
    {
        private readonly static string _connectionString;

        static ConnectionFactory()
        {
            _connectionString = AppSettingsHelper.Configuration.GetConnectionString("StudentDB");
        }

        public static IDbConnection CreateConnection()
            => new Microsoft.Data.SqlClient.SqlConnection(_connectionString);
    }
}
